home *** CD-ROM | disk | FTP | other *** search
/ Language/OS - Multiplatform Resource Library / LANGUAGE OS.iso / smaltalk / st80_pr4.lha / st80_pre4 / Foible / foible / Foible4.1-PPfix.st < prev    next >
Text File  |  1993-07-24  |  3KB  |  98 lines

  1. 'From Objectworks for Smalltalk-80(tm), Version 2.5 of 29 July 1989 on 16 April 1990 at 11:26:31 am'!
  2.  
  3. !CanvasView methodsFor: 'private'!
  4.  
  5. computeDisplayTransformation
  6.     "Answer a new windowingTransformation that transforms the 
  7.     coordinate system of the canvas into that of the display screen. 
  8.     Don't scale a canvasView; window and viewport are same size in Foible."
  9.  
  10.     | newTranslation |
  11.     
  12.     newTranslation _ transformation translation + superView displayTransformation translation.
  13.     ^WindowingTransformation scale: nil translation: newTranslation! !
  14.  
  15.  
  16. !StandardSystemView methodsFor: 'framing'!
  17.  
  18. resizeSubviews
  19.     "check and change the sizes of nonstandard subviews"
  20.  
  21.     ^self! !
  22.  
  23.  
  24. !FoibleView methodsFor: 'framing'!
  25.  
  26. resizeSubviews
  27.     "Just ask the toolBenchView to resize its subviews."
  28.  
  29.     self firstSubView resizeSubviews! !
  30.  
  31. !FoibleView methodsFor: 'label access'!
  32.  
  33. newLabel: aString 
  34.     "Change the name of the models when the label is changed"
  35.  
  36.     model notNil ifTrue: [self model name: aString].
  37.     super newLabel: aString! !
  38.  
  39.  
  40. !ToolBenchView methodsFor: 'framing'!
  41.  
  42. resizeSubviews
  43.     "Determine the rectangular area for the receiver, adjusted 
  44.     to the minimum and maximum sizes."
  45.  
  46.     | viewBounds canvasWindow canvasViewPort canvasExtent numOfViews upperLeft |
  47.     
  48.     viewBounds _ self superView viewport.  "get bounds from the FoibleView."
  49.     self unlock.
  50.     canvasExtent _ viewBounds extent.
  51.     numOfViews _ self canvas size.
  52.     canvasExtent _ canvasExtent x // numOfViews @ canvasExtent y.
  53.     canvasWindow _ Rectangle origin: 0 @ 0 extent: canvasExtent.
  54.     upperLeft _ 0 @ 0.
  55.     self canvas do: 
  56.         [:each | 
  57.         canvasViewPort _ Rectangle origin: upperLeft extent: canvasExtent.
  58.         upperLeft _ canvasViewPort topRight.
  59.         each window: canvasWindow viewport: canvasViewPort]! !
  60.  
  61.  
  62. !StandardSystemController methodsFor: 'private'!
  63.  
  64. trackFrame
  65.     "Track the mouse and set the displayBox of the view"
  66.  
  67.     | frame background| 
  68.     frame _ view displayBox.
  69.     view minimumSize = view maximumSize ifTrue: [^self].
  70.     background _ Form fromDisplay: view labelDisplayBox.
  71.     view displayLabel.
  72.     sensor cursorPoint: ((frame corner
  73.                                         max: sensor cursorPoint)
  74.                                         min: frame origin + view maximumSize).
  75.     Cursor corner
  76.         showWhile: 
  77.             [Display
  78.                 outline: [frame corner: ((sensor cursorPoint
  79.                                         max: (frame origin + view minimumSize))
  80.                                         min: (frame origin + view maximumSize))]
  81.                 while: [Sensor anyButtonPressed]
  82.                 width: 2
  83.                 halftone: Form gray].
  84.     background displayAt: view labelDisplayBox origin.
  85.     view window: view window viewport: frame.
  86.     view resizeSubviews! !
  87.  
  88. !PaletteController methodsFor: 'basic control sequence'!
  89.  
  90. controlInitialize
  91.     | displayBox  | 
  92.     displayBox _ view insetDisplayBox expandBy: 0@2.
  93.     scrollBar _ scrollBar align: scrollBar topRight with: displayBox topLeft.
  94.     self class getSavedAreaFor: scrollBar.
  95.     scrollBar display.
  96.     self displayTools! !
  97.  
  98.